package com.sinosoft.dsp.platform.components.portal.iteration;

import java.util.List;

import com.sinosoft.dsp.platform.exception.SinoPlatformException;

public abstract class SinoAbstractLazyDataTableViewBean<T extends IDataTableObject>
		extends SinoAbstractDataTableViewBean<T> implements
		ISinoLazyDataTableViewBean<T> {

	private SinoLazyDataModel<T> lazyModel;

	/**
	 * 该方法在本类中没有被使用
	 */
	@Override
	public List<T> load() {
		return null;
	}
	
	@Override
	public boolean loadFromOutset(){
		return false;
	}

	/**
	 * 获得懒加载模式
	 * 
	 * @return
	 * @throws SinoPlatformException
	 */
	@Override
	public SinoLazyDataModel<T> getLazyModel() throws SinoPlatformException {
		if (!hasLoadFlag || lazyModel == null) {
			this.lazyModel = new SinoLazyDataModel<T>(this);
			this.selectedRows = null;
			this.hasLoadFlag = true;
		}
		return this.lazyModel;
	}

}
